package com.csk.zsk.compents.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.csk.zsk.commons.orm.PropertyFilter.MatchType;
import com.csk.zsk.compents.dao.PersoncollectionDao;
import com.csk.zsk.compents.entity.Personcollection;
import com.csk.zsk.compents.service.PersoncollectionService;

@Service
@Transactional
public class PersoncollectionServiceImpl implements PersoncollectionService {

	@Autowired
	private PersoncollectionDao personcollectionDao;

	@Override
	public void savePersoncollection(Personcollection personcollection) {
		personcollectionDao.save(personcollection);

	}

	@Override
	public void deletePersoncollection(String id) {
		personcollectionDao.delete(id);

	}

	@Override
	@Transactional(readOnly = true)
	public List<Personcollection> searchPersoncollection(String title, String userid) {
		return personcollectionDao.findBy("title", title, MatchType.LIKE);
	}

}
